/**
 * @Author: lifuzhao
 * @Date: 2019-08-06
 * @Project: shop_cms
 */
import Vue from 'vue';
import Router from 'vue-router';
import defaultContainer from '../containers/default.vue';

Vue.use(Router);

const router = new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'index',
      component: defaultContainer,
      children: [{
        path: '/product',
        name: 'product',
        component: () => import(/* webpackChunkName: "product-index" */ '../views/product/index.vue'),
      }, {
        path: 'product/manage',
        name: 'product-manage',
        component: () => import(/* webpackChunkName: "product-manage" */ '../views/product/manage.vue'),
      }, {
        path: 'product/classify',
        name: 'product-classify',
        component: () => import(/* webpackChunkName: "product-classify" */ '../views/product/classify.vue'),
      }, {
        path: '/order/manage',
        name: 'order-manage',
        component: () => import(/* webpackChunkName: "order-manage" */ '../views/order/manage.vue'),
      }, {
        path: '/order/afterSaleService/comment',
        name: 'order-afterSaleService-comment',
        component: () => import(/* webpackChunkName: "order-afterSaleService-comment" */ '../views/order/afterSaleService/comment.vue'),
      }, {
        path: 'retail/config',
        name: 'retail-config',
        component: () => import(/* webpackChunkName: "retail-config" */ '../views/retail/config.vue'),
      }, {
        path: 'retail/salerManage',
        name: 'retail-salerManage',
        component: () => import(/* webpackChunkName: "retail-salerManage" */ '../views/retail/salerManage.vue'),
      }, {
        path: 'finance/operation/withdraw',
        name: 'finance-operation-withdraw',
        component: () => import(/* webpackChunkName: "finance-operation-withdraw" */ '../views/finance/operation/withdraw.vue'),
      }, {
        path: 'finance/record/recharge',
        name: 'finance-record-recharge',
        component: () => import(/* webpackChunkName: "finance-record-recharge" */ '../views/finance/record/recharge.vue'),
      }, {
        path: 'finance/record/capitalMonitoring',
        name: 'finance-operation-capitalMonitoring',
        component: () => import(/* webpackChunkName: "finance-record-capitalMonitoring" */ '../views/finance/record/capitalMonitoring.vue'),
      }, {
        path: 'finance/commission/record',
        name: 'finance-commission-record',
        component: () => import(/* webpackChunkName: "finance-commission-record" */ '../views/finance/commission/record.vue'),
      }],
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue'),
    },
  ],
});
router.beforeEach();
export default router;
